package com.gxa.park.core.pojo.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author mincheung
 * @since 2022-07-18
 */
@TableName("tb_user")
@ApiModel(value = "User对象", description = "")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {

    private static final long serialVersionUID = 1L;
    @ApiModelProperty("主键自增id")
      @TableId(value = "u_id", type = IdType.AUTO)
    private Integer uId;

    @ApiModelProperty("用户手机号")
    @TableField("u_phone")
    private String uPhone;

    @ApiModelProperty("用户名")
    @TableField("u_name")
    private String uName;

    @ApiModelProperty("车牌号外键")
    @TableField("u_carid")
    private Integer uCarid;

    @ApiModelProperty("逻辑删除")
    @TableField("u_delete")
    @TableLogic
    private Boolean uDelete;

    @ApiModelProperty("注册时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField("u_register_time")
    private LocalDateTime uRegisterTime;

    @ApiModelProperty("最近登录时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField("u_last_logintime")
    private LocalDateTime uLastLogintime;

    @ApiModelProperty("1 正常 2 冻结  3注销")
    @TableField("u_status")
    private Integer uStatus;

    @ApiModelProperty("用户编号id")
    @TableField("u_number")
    private String uNumber;

}
